import React from 'react';

export default class ExpressionsAsChildren extends React.Component {
    // Calls the children callback numTimes to produce a repeated component
    render() {
        function Item(props) {
            return <li>{props.message}</li>;
        }

        const todos = ['finish doc', 'submit pr', 'nag dan to review'];
        return (
            <ul>
                {todos.map((message) => <Item key={message} message={message} />)}
            </ul>
        );
    }
}